/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.pay.e.b;
import com.qihoo.gamecenter.sdk.pay.k.c;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class s extends d {
    public s(Context paramContext, d.a parama) {
        super(paramContext, parama, true);
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "https://mgame.360.cn/internal/mobile_pay_status.json";
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        String str1 = a(0, paramArrayOfString);
        String str2 = a(1, paramArrayOfString);
        if ((TextUtils.isEmpty(str1)) || (TextUtils.isEmpty(str2)))
            return null;
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("user_id", str1);
        localTreeMap.put("order_id", str2);
        localTreeMap.put("app_key", com.qihoo.gamecenter.sdk.common.i.s.r(paramContext));
        String str3 = b.a(paramContext);
        c.a("OAMobilePayStatusTask", new Object[] { "quickInfo=", str3 });
        if (!(TextUtils.isEmpty(str3)))
            localTreeMap.put("quick_info", str3);
        try {
            Thread.sleep(3000L);
        } catch (Exception localException) {
            c.c("OAMobilePayStatusTask", new Object[] { localException.toString() });
        }
        String str4 = com.qihoo.gamecenter.sdk.common.i.s.a(localTreeMap,
                com.qihoo.gamecenter.sdk.common.i.s.s(paramContext));
        c.a("OAMobilePayStatusTask", new Object[] { "https://mgame.360.cn/internal/mobile_pay_status.json", "?", str4 });
        return localTreeMap;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            int i = paramJSONObject.optInt("error_code", -1);
            int j = paramJSONObject.optInt("status_code", -1);
            String str = paramJSONObject.optString("status_text");
            if (i != -1) {
                boolean bool = paramJSONObject.optInt("is_bind", 0) == 1;
                int k = paramJSONObject.optInt("amount", 0);
                a locala = new a();
                locala.a(i);
                locala.b(j);
                locala.a(str);
                locala.a(bool);
                locala.c(k);
                return locala;
            }
        }
        return null;
    }

    public static class a {
        private int a;
        private int b;
        private String c;
        private int d;
        private boolean e;

        public int a() {
            return this.a;
        }

        public void a(int paramInt) {
            this.a = paramInt;
        }

        public int b() {
            return this.b;
        }

        public void b(int paramInt) {
            this.b = paramInt;
        }

        public String c() {
            return this.c;
        }

        public void a(String paramString) {
            this.c = paramString;
        }

        public boolean d() {
            return this.e;
        }

        public void a(boolean paramBoolean) {
            this.e = paramBoolean;
        }

        public void c(int paramInt) {
            this.d = paramInt;
        }
    }
}